import request from '@/utils/request'

// 查询顾客列表
export function listCustomer(query) {
  return request({
    url: '/system/customer/list',
    method: 'get',
    params: query
  })
}

// 查询顾客详细
export function getCustomer(customerId) {
  return request({
    url: '/system/customer/' + customerId,
    method: 'get'
  })
}

// 新增顾客
export function addCustomer(data) {
  return request({
    url: '/system/customer',
    method: 'customer',
    data: data
  })
}

// 修改顾客
export function updateCustomer(data) {
  return request({
    url: '/system/customer',
    method: 'put',
    data: data
  })
}

// 删除顾客
export function delCustomer(customerId) {
  return request({
    url: '/system/customer/' + customerId,
    method: 'delete'
  })
}

// 更新顾客余额
export function updateBal(id, value) {
  return request({
    url: '/system/customer/balance/' + id + "/" + value,
    method: 'put'
  })
}

// 更新顾客积分
export function updateCoins(id, value) {
  return request({
    url: '/system/customer/coins/' + id + "/" + value,
    method: 'put'
  })
}